<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
<title>学员考试成绩</title>
<script type="text/javascript" src="../../js/jquery.min.js"></script>
<script type="text/javascript" src="../../js/jquery.pagination.js"></script>
<script type="text/javascript" src="../../js/bootstrap.min.js"></script>
<script type="text/javascript" src="../../js/public.js"></script>
<script type="text/javascript" src="../../js/http.js"></script>
<script type="text/javascript" src="../../js/alert.js"></script>
<script type="text/javascript" src="../../js/jquery-ui/jquery-ui.min.js"></script>
<link rel="stylesheet" type="text/css" href="../../js/jquery-ui/jquery-ui.css">
<link rel="stylesheet" type="text/css" href="../../css/bootstrap.css">
</head>
<body>
	<div class="right_mainH4">
		<p>
			学员考试成绩详细记录<small>Control panel</small>
		</p>
	</div>
	
	<div>
		<button type="button" onclick="addKeMuResult();" class="btn btn-danger">添加考试成绩</button>
	</div>
	</br>
	<table class="table table-bordered" id="datas">
		<tr>
			<td name="keMu">培训部分</td>
			<td name="score">考试成绩</td>
			<td name="qualified">考试结果</td>
			<td name="time">考试时间</td>
			<td name="place">考试地点</td>
			<td name="id" other="result">操作</td>
		</tr>
	</table>
	
	<!-- 分页控件 -->
    <div class="pager">
    </div>
    
     <!-- 学员考试成绩信息 -->
     <div id="addResultDiv" style="display:none;" title="学员考试成绩信息">
     	<iframe src="" style="width:100%;height: 100%" frameborder="no" marginwidth="0" marginheight="0" allowtransparency="yes"></iframe>
     </div>
     
     <!-- 修改学员考试成绩信息 -->
     <div id="resultInfoDiv" style="display:none;" title="学员考试成绩信息">
     	<iframe src="" style="width:100%;height: 100%" frameborder="no" marginwidth="0" marginheight="0" allowtransparency="yes"></iframe>
     </div>
   
    <script type="text/javascript">
	    var href = location.href.split("=");
		var stuId = href[1];
    	searchPage(1,10);
    	
    	//分页查询
    	function searchPage(pageNo,pageSize){
    		$.ajax({
    			url : "../../keMuResult/find.ao",
    			type : 'POST',
    			data : {
    				"pageNo" : pageNo,
    				"pageSize" : pageSize,
    				"id" : stuId
    			},
    			beforeSend : ajaxstar,
    			complete : ajaxend,
    			cache : false,
    			dataType : "json",
    			success : function(data) {
    				if (data["state"] == "success") {
    					insertTr(data, 0);
    				} else {
    					sAlert(data["result"]);
    				}
    			}
    		});
    	}
    
    	
    	//添加考试成绩
    	function addKeMuResult(){
    		$("#addResultDiv").find("iframe").attr("src","addResult.html?id="+stuId);
			$("#addResultDiv").dialog({
				title : "添加考试成绩信息",
				resizable : false,
				width : 650,
				height : 400,
				resizable : true,
				modal : true,
				buttons : {
					"关闭" : function() {
						$(this).dialog("close");
					}
				}
			});
    	}
    	
    	function look(id){
    		$("#resultInfoDiv").find("iframe").attr("src","resultInfo.html?id="+id);
			$("#resultInfoDiv").dialog({
				title : "修改考试成绩信息",
				resizable : false,
				width : 650,
				height : 400,
				resizable : true,
				modal : true,
				buttons : {
					"关闭" : function() {
						$(this).dialog("close");
					}
				}
			});
    	}
    	
    	//删除
    	function del(id){
    		if(confirm("确定删除吗?")){
    			$.ajax({
    				url : "../../keMuResult/del.ao",
    				type : 'POST',
    				data : {
    					"id" : id
    				},
    				cache : false,
    				dataType : "json",
    				success : function(data){
    					sAlert(data["result"]);
    					if(data["state"] == "success"){
    						window.parent.searchPage(1,10);
    					}
    				}
    			});
    		}
    	}
    </script>
</body>
</html>